Skip to content

Instantly share code, notes, and snippets.

@kohenkatz
kohenkatz / generate_ulid_text.sql
Created April 28, 2020 06:29
Postgres stuff for working with ULID
-- From https://github.com/geckoboard/pgulid/blob/d6187a00f66dca196cf5242588f87c3a7969df75/pgulid.sql
--
-- pgulid is based on OK Log's Go implementation of the ULID spec
--
-- https://github.com/oklog/ulid
-- https://github.com/ulid/spec
--
-- Copyright 2016 The Oklog Authors
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
@bendc
bendc / easing.css
Created September 23, 2016 04:12
Easing CSS variables
:root {
--ease-in-quad: cubic-bezier(.55, .085, .68, .53);
--ease-in-cubic: cubic-bezier(.550, .055, .675, .19);
--ease-in-quart: cubic-bezier(.895, .03, .685, .22);
--ease-in-quint: cubic-bezier(.755, .05, .855, .06);
--ease-in-expo: cubic-bezier(.95, .05, .795, .035);
--ease-in-circ: cubic-bezier(.6, .04, .98, .335);
--ease-out-quad: cubic-bezier(.25, .46, .45, .94);
--ease-out-cubic: cubic-bezier(.215, .61, .355, 1);
@sergev
sergev / debian-mipsel-on-qemu.md
Last active May 13, 2024 17:16
Installing Debian MIPS32 on QEMU

Let's install Debian 9.0 "Stretch" on QEMU MIPS32 under Ubuntu.

Step 1: Install QEMU

sudo apt install qemu-system-mips

Step 2: Download Linux kernel and installation image

wget http://ftp.debian.org/debian/dists/stretch/main/installer-mipsel/current/images/malta/netboot/vmlinux-4.9.0-11-4kc-malta
@marko-knoebl
marko-knoebl / react-checklist-en.md
Created November 25, 2022 10:20
A checklist for learning React - Fork it and start ticking off topics!

React topics checklist

A checklist for learning React - Fork it and start ticking off topics!

React fundamentals

  • use-cases of React
  • JavaScript basics for React
    • immutability / data management without mutations
  • updating properties of objects
Maintainers:
davidtwco: cargo-bisect-rustc, cargo-bisect-rustc
@OrionReed
OrionReed / dom3d.js
Last active May 13, 2024 17:14
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@cheginit
cheginit / texlive.profile
Created February 15, 2020 01:35
custom texlive installation profile to use with sudo ./install-tl -profile
# texlive.profile written on Sat Feb 15 01:13:54 2020 UTC
# It will NOT be updated and reflects only the
# installation profile at installation time.
selected_scheme scheme-custom
TEXDIR /usr/local/texlive/2019
TEXMFCONFIG ~/.texlive2019/texmf-config
TEXMFHOME ~/texmf
TEXMFLOCAL /usr/local/texlive/texmf-local
TEXMFSYSCONFIG /usr/local/texlive/2019/texmf-config
TEXMFSYSVAR /usr/local/texlive/2019/texmf-var
@iurysza
iurysza / create-dependency-graph.gradle.kts
Created March 13, 2023 18:42
Creates a mermaid dependency graph for the project and add it to the README
task("createMermaidDependencyGraph") {
group = "Reporting"
description = "Creates a mermaid dependency graph for the project"
doLast {
val projects = mutableSetOf<Project>()
val dependencies = mutableListOf<Pair<Project, Project>>()
val queue = mutableListOf(rootProject)
while (queue.isNotEmpty()) {
val project = queue.removeAt(0)
queue.addAll(project.childProjects.values)
@hantoine
hantoine / tensorboard_in_kaggle_notebook.py
Last active May 13, 2024 17:11
Launch TensorBoard in a Kaggle notebook and create a tunnel with ngrok to access it
from urllib.request import urlopen
from io import BytesIO
from zipfile import ZipFile
from subprocess import Popen
from os import chmod
from os.path import isfile
import json
import time
import psutil
@MaskRay
MaskRay / kernel-arm64.md
Created May 2, 2023 06:57
Linux kernel's arm64 port

In the kernel source directory, run

make O=/tmp/linux/arm64 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j60 defconfig all

Then create an Alpine aarch64 image following https://hackmd.io/@starnight/Run_Alpine_on_QEMU_aarch64_Virtual_Machine

wget https://dl-cdn.alpinelinux.org/alpine/latest-stable/releases/aarch64/netboot/vmlinuz-lts https://dl-cdn.alpinelinux.org/alpine/latest-stable/releases/aarch64/netboot/config-lts